﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WarriorRush.GameDynamics.SpecialAbilities
{
    public class HardenSkin : SpecialAbility
    {

        private List<EffectType> effects;

        public HardenSkin()
            : base()
        {
            AbilityType = AbilityTypes.HardenSkin;
            effects = new List<EffectType> { EffectType.Blinded, EffectType.Shielded };
            
        }

        public override bool Execute(CharacterClass abilityTarget, Arena arena, List<CharacterClass> additonalTargets)
        {

            AbilityOwner.TakeEffects(Effects[EffectType.Shielded].GetInstance(Power), Effects[EffectType.Blinded].GetInstance(Power));
            return base.Execute(abilityTarget, arena, additonalTargets);
        }

        public override SpecialAbility GetInstance(int power)
        {
            var inst = new HardenSkin
            {
                Power = power,
                ReplacesAttack = this.ReplacesAttack
            };
            foreach (var effect in effects)
            {
                inst.Effects.Add(effect, null);
            }
            
            return inst;

        }
    }
}
